<%@page import="com.ibm.eg.cvmanager.dto.INTERVIEW_STATUS"%>
<%@page import="com.ibm.eg.cvmanager.dto.Interview"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=windows-1256"
    pageEncoding="windows-1256"%>

<%
if(((List<Interview>) session.getAttribute("interviews")).isEmpty()) {
%>
	<p align="center">
	No Result Found
	</p>
<%
} else {	
%>
	<form id="resultForm" method="post" action="hellopage.jsp">
		<table border="1" align="center">
		<tr>
			<th>Delete</th>
			<th>applicant</th>
			<th>date</th>
			<th>state</th>
			<th>Download CV</th>
		</tr>
		<% 
		
		List<Interview> interviews = (List<Interview>)session.getAttribute("interviews"); 
		
		for(int i = 0;i < interviews.size();i++) {
			Interview interview = interviews.get(i);
		%>
			<tr>
				<td><input name="delete" value="<%=i%>" type="checkbox"/></td>
				
				<td><%=interview.getApplicant().getName()%></td>
				<td><%=interview.getInterviewdate()%></td>
				<td><%=INTERVIEW_STATUS.values()[interview.getStatus()].name()%></td>
				<td><a href="addpage.jsp?id=<%=interview.getId()%>">Update</a></td>
				<td><a href="/CVManagerWeb/DownloadServlet">Download</a></td>
			</tr>
		<%
		}
		%>
		</table>
	
		<button id="deleteButton" type="button" onclick="del();">Delete</button>
	</form>
<%
}
%>